package problem69;


//69.x的平方根
//https://leetcode.cn/problems/sqrtx/

class Solution {
    public int mySqrt(int x) {
        int left = 0, right = (int)Math.sqrt(2147395599)+1;
        while(left < right) {
            int mid = left + (right - left + 1)/2;
            if(mid * mid <= x) {
                left = mid;
            }else {
                right = mid-1;
            }
        }
        return left;
    }
}
